home *** CD-ROM | disk | FTP | other *** search
/ Mac Mania 2 / MacMania 2.toast / Demo's / Tools&Utilities / Programming / Algorithms Folder / upload / parse.bas < prev    next >
Unknown  |  1994-05-18  |  2.5 KB  |  [ZTKN/ZBAS]

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was not able to be converted.
This format is not currently supported by dexvert.

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert GW-BASIC (document/gwBasic) ext Supported
66% dexvert GFA-BASIC Atari (other/gfaBASICAtari) ext Supported
1% dexvert Amiga BASIC Protected File (other/amigaBASICProtectedFile) ext Unsupported
1% dexvert BAS VBDOS Pro 1.0 Source (other/basVBDOSPro10Source) ext Unsupported
1% dexvert Visual Basic Tokenized Source (other/visualBasicTokenizedSource) ext Unsupported
1% dexvert ZBASIC (other/zbasic) ext Unsupported
100% file data default


id metadata
keyvalue
macFileType[ZTKN]
macFileCreator[ZBAS]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 3a 00 00 00 00 00 00 | f0 5a 63 6f 70 79 72 69 |.:......|.Zcopyri|
|00000010| 67 68 74 20 31 39 39 34 | 20 62 79 20 53 74 65 70 |ght 1994| by Step|
|00000020| 68 65 6e 20 42 6f 65 72 | 6e 65 72 2c 20 65 79 65 |hen Boer|ner, eye|
|00000030| 20 73 79 73 74 65 6d 73 | 2d 20 00 00 00 44 00 00 | systems|- ...D..|
|00000040| ff c4 00 00 f0 5a 43 49 | 53 2d 37 34 32 30 33 2c |.....ZCI|S-74203,|
|00000050| 32 32 31 37 20 20 20 41 | 4f 4c 2d 49 53 49 53 49 |2217 A|OL-ISISI|
|00000060| 4e 43 20 20 42 4d 55 47 | 2c 20 49 4e 54 45 52 4e |NC BMUG|, INTERN|
|00000070| 45 54 20 45 59 45 53 59 | 53 40 43 52 4c 2e 43 4f |ET EYESY|S@CRL.CO|
|00000080| 4d 00 00 2c 00 00 ff ba | 00 00 f0 5a 4d 41 59 20 |M..,....|...ZMAY |
|00000090| 4e 4f 54 20 42 45 20 55 | 53 45 44 20 46 4f 52 20 |NOT BE U|SED FOR |
|000000a0| 43 4f 4d 4d 45 52 43 49 | 41 4c 20 47 41 49 4e 00 |COMMERCI|AL GAIN.|
|000000b0| 00 0c 00 01 ff d2 00 00 | f0 16 20 62 00 00 00 46 |........|.. b...F|
|000000c0| 00 00 ff f2 00 00 f0 13 | 20 20 20 20 20 20 20 20 |........| |
|000000d0| 20 61 20 73 69 6d 70 6c | 65 20 70 61 72 73 65 72 | a simpl|e parser|
|000000e0| 20 66 6f 72 20 72 65 67 | 75 6c 61 72 20 65 78 70 | for reg|ular exp|
|000000f0| 72 65 73 73 69 6f 6e 73 | 20 77 69 74 68 20 61 63 |ressions| with ac|
|00000100| 74 69 6f 6e 73 00 00 38 | 00 00 ff b8 00 00 f0 13 |tions..8|........|
|00000110| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 73 | | s|
|00000120| 65 64 67 65 77 69 63 6b | 20 41 4c 47 4f 52 49 54 |edgewick| ALGORIT|
|00000130| 48 4d 53 20 63 68 61 70 | 74 65 72 20 32 30 00 00 |HMS chap|ter 20..|
|00000140| 00 08 00 01 ff c6 00 00 | 00 00 00 3c 00 04 ff f6 |........|...<....|
|00000150| 00 00 f2 08 20 23 31 2c | 20 22 72 65 67 75 6c 61 |.... #1,| "regula|
|00000160| 72 20 65 78 70 72 65 73 | 73 69 6f 6e 73 22 2c 28 |r expres|sions",(|
|00000170| 34 2c 33 38 29 2d 28 36 | 35 30 2c 35 30 30 29 3a |4,38)-(6|50,500):|
|00000180| f0 28 20 31 30 30 00 00 | 00 3a 00 05 ff c2 00 00 |.( 100..|.:......|
|00000190| f0 64 20 30 2c 20 5f 63 | 61 73 65 49 6e 73 65 6e |.d 0, _c|aseInsen|
|000001a0| 73 69 74 69 76 65 20 5f | 73 74 72 52 65 73 6f 75 |sitive _|strResou|
|000001b0| 72 63 65 20 5f 6d 61 63 | 73 62 75 67 4c 61 62 65 |rce _mac|sbugLabe|
|000001c0| 6c 73 20 00 00 0e 00 06 | ff c4 00 00 f0 19 20 41 |ls .....|...... A|
|000001d0| 2d 5a 00 00 00 1a 00 07 | ff f0 00 00 f0 0a 20 74 |-Z......|...... t|
|000001e0| 79 70 65 73 24 28 31 30 | 29 2c 4c 28 31 30 29 00 |ypes$(10|),L(10).|
|000001f0| 00 4e 00 08 ff e4 00 00 | 6d 65 74 61 24 3d 22 26 |.N......|meta$="&|
|00000200| 22 3a 61 63 74 24 3d 22 | 24 22 f0 5a 20 6d 65 74 |":act$="|$".Z met|
|00000210| 61 20 63 68 61 72 20 66 | 6f 72 20 72 65 67 75 6c |a char f|or regul|
|00000220| 61 72 20 76 61 72 73 3d | 26 2c 20 66 6f 72 20 61 |ar vars=|&, for a|
|00000230| 63 74 69 6f 6e 20 76 61 | 72 73 20 3d 20 24 00 00 |ction va|rs = $..|
|00000240| 00 08 00 09 ff b0 00 00 | 00 00 00 4e 00 0a ff f6 |........|...N....|
|00000250| 00 00 61 24 3d 22 7b 26 | 53 7b 26 4e 7d 2a 24 63 |..a$="{&|S{&N}*$c|
|00000260| 7b 26 4c 24 6e 7b 21 26 | 4e 7b 26 4e 7d 2a 7d 24 |{&L$n{!&|N{&N}*}$|
|00000270| 65 7d 2a 7d 2a 3d 26 4e | 7b 26 4e 7d 2a 24 72 22 |e}*}*=&N|{&N}*$r"|
|00000280| f0 5a 20 74 68 65 20 72 | 65 67 75 6c 61 72 20 65 |.Z the r|egular e|
|00000290| 78 70 72 65 73 73 69 6f | 6e 00 00 3c 00 0b ff b0 |xpressio|n..<....|
|000002a0| 00 00 f0 13 20 20 20 20 | 20 20 20 26 53 20 69 73 |.... | &S is|
|000002b0| 20 74 68 65 20 73 69 67 | 6e 2c 20 26 4e 20 61 20 | the sig|n, &N a |
|000002c0| 6e 75 6d 62 65 72 2c 20 | 26 4c 20 61 20 6c 65 74 |number, |&L a let|
|000002d0| 74 65 72 2e 20 20 00 00 | 00 54 00 0c ff c2 00 00 |ter. ..|.T......|
|000002e0| f0 13 20 20 20 20 20 20 | 20 24 63 20 63 68 65 63 |.. | $c chec|
|000002f0| 6b 20 63 6f 65 66 20 2c | 24 6e 20 63 68 65 63 6b |k coef ,|$n check|
|00000300| 20 6e 61 6d 65 2c 20 24 | 65 20 63 68 65 63 6b 20 | name, $|e check |
|00000310| 65 78 70 6f 6e 65 6e 74 | 2c 20 24 72 20 63 68 65 |exponent|, $r che|
|00000320| 63 6b 20 72 69 67 68 74 | 20 73 69 64 65 00 00 08 |ck right| side...|
|00000330| 00 0d ff aa 00 00 00 00 | 00 3c 00 0e ff f6 00 00 |........|.<......|
|00000340| 74 79 70 65 73 24 28 31 | 29 3d 22 53 3d 2b 3d 2d |types$(1|)="S=+=-|
|00000350| 22 20 3a 74 79 70 65 73 | 24 28 32 29 3d 22 4e 3e |" :types|$(2)="N>|
|00000360| 30 39 22 3a 74 79 70 65 | 73 24 28 33 29 3d 22 4c |09":type|s$(3)="L|
|00000370| 3e 41 7a 22 00 00 00 62 | 00 0f ff c2 00 00 f0 13 |>Az"...b|........|
|00000380| 20 74 68 69 73 20 72 65 | 63 6f 67 6e 69 7a 65 73 | this re|cognizes|
|00000390| 20 61 20 53 69 67 6e 20 | 61 73 20 3d 20 22 2b 22 | a Sign |as = "+"|
|000003a0| 20 6f 72 20 3d 20 22 2d | 22 2c 20 61 20 4e 75 6d | or = "-|", a Num|
|000003b0| 62 65 72 20 62 65 74 77 | 65 65 6e 20 30 20 61 6e |ber betw|een 0 an|
|000003c0| 64 20 39 2c 20 61 20 4c | 65 74 74 65 72 20 66 72 |d 9, a L|etter fr|
|000003d0| 6f 6d 20 41 20 74 6f 20 | 7a 00 00 08 00 10 ff 9c |om A to |z.......|
|000003e0| 00 00 00 00 00 10 00 11 | ff f6 00 00 f0 1f 20 f0 |........|...... .|
|000003f0| 66 20 20 20 20 00 00 08 | 00 12 ff ee 00 00 00 00 |f ...|........|
|00000400| 00 2a 00 00 ff f6 00 02 | f0 61 20 f2 02 20 72 65 |.*......|.a .. re|
|00000410| 63 6f 67 6e 69 7a 65 28 | 63 24 2c 64 24 29 3a 66 |cognize(|c$,d$):f|
|00000420| 6f 75 6e 64 3d 5f 66 61 | 6c 73 65 00 00 38 00 14 |ound=_fa|lse..8..|
|00000430| ff d4 02 02 f0 13 20 74 | 68 69 73 20 70 61 72 74 |...... t|his part|
|00000440| 20 69 6e 74 65 72 70 72 | 65 74 73 20 74 68 65 20 | interpr|ets the |
|00000450| 74 79 70 65 73 24 20 6d | 69 6e 2d 72 65 63 6f 67 |types$ m|in-recog|
|00000460| 6e 69 7a 65 72 00 00 08 | 00 15 ff c6 02 02 00 00 |nizer...|........|
|00000470| 00 3c 00 16 ff f6 00 02 | 6b 3d 31 3a f0 37 20 f4 |.<......|k=1:.7 .|
|00000480| 30 28 74 79 70 65 73 24 | 28 6b 29 2c 31 29 3c 3e |0(types$|(k),1)<>|
|00000490| 64 24 3a 6b 3d 6b 2b 31 | 3a f0 38 3a 78 24 3d 74 |d$:k=k+1|:.8:x$=t|
|000004a0| 79 70 65 73 24 28 6b 29 | 3a 6b 3d 32 00 00 00 28 |ypes$(k)|:k=2...(|
|000004b0| 00 17 ff c2 02 04 f0 33 | 3a 79 24 3d f4 32 28 78 |.......3|:y$=.2(x|
|000004c0| 24 2c 6b 2b 31 2c 31 29 | 3a 7a 24 3d f4 32 28 78 |$,k+1,1)|:z$=.2(x|
|000004d0| 24 2c 6b 2c 31 29 00 00 | 00 38 00 18 ff d6 04 04 |$,k,1)..|.8......|
|000004e0| f0 0f 20 7a 24 3d 22 3d | 22 20 f6 05 20 6b 3d 6b |.. z$="=|" .. k=k|
|000004f0| 2b 32 3a f0 0f 20 63 24 | 3d 79 24 20 f6 05 20 66 |+2:.. c$|=y$ .. f|
|00000500| 6f 75 6e 64 3d 5f 7a 74 | 72 75 65 3a f0 6f 20 f2 |ound=_zt|rue:.o .|
|00000510| 02 00 00 4e 00 19 ff c6 | 04 04 f0 0f 20 7a 24 3d |...N....|.... z$=|
|00000520| 22 3e 22 20 f6 05 20 6b | 3d 6b 2b 33 3a f0 0f 20 |">" .. k|=k+3:.. |
|00000530| 63 24 3e 3d 79 24 20 f6 | 07 20 63 24 3c 3d f4 32 |c$>=y$ .|. c$<=.2|
|00000540| 28 78 24 2c 6b 2d 31 2c | 31 29 20 f6 05 20 66 6f |(x$,k-1,|1) .. fo|
|00000550| 75 6e 64 3d 5f 7a 74 72 | 75 65 3a f0 6f 20 f2 02 |und=_ztr|ue:.o ..|
|00000560| 00 00 00 12 00 1a ff b0 | 02 02 f0 34 20 6b 3e f4 |........|...4 k>.|
|00000570| 0f 28 78 24 29 00 00 14 | 00 00 ff ec 00 00 f0 1f |.(x$)...|........|
|00000580| 20 f2 02 20 3d 20 66 6f | 75 6e 64 00 00 08 00 1c | .. = fo|und.....|
|00000590| ff ea 00 00 00 00 00 28 | 00 1d ff f6 00 02 f0 61 |.......(|.......a|
|000005a0| 20 f2 02 20 70 61 72 73 | 65 28 72 65 67 75 6c 61 | .. pars|e(regula|
|000005b0| 72 24 2c 74 65 73 74 73 | 74 72 69 6e 67 24 29 00 |r$,tests|tring$).|
|000005c0| 00 2a 00 1e ff d6 02 02 | 6c 61 3d f4 0f 28 72 65 |.*......|la=..(re|
|000005d0| 67 75 6c 61 72 24 29 3a | 69 3d 30 3a 6a 3d 30 3a |gular$):|i=0:j=0:|
|000005e0| f0 0d 20 22 66 6f 75 6e | 64 22 00 00 00 28 00 1f |.. "foun|d"...(..|
|000005f0| ff d4 02 04 f0 33 3a 6c | 61 73 74 64 24 3d 64 24 |.....3:l|astd$=d$|
|00000600| 3a 64 24 3d f4 32 28 72 | 65 67 75 6c 61 72 24 2c |:d$=.2(r|egular$,|
|00000610| 69 2c 31 29 00 00 00 26 | 00 20 ff d6 04 04 f0 0f |i,1)...&|. ......|
|00000620| 20 64 24 3d 22 7b 22 20 | f6 05 20 6c 28 6c 65 76 | d$="{" |.. l(lev|
|00000630| 29 3d 69 3a 6c 65 76 3d | 6c 65 76 2b 31 00 00 26 |)=i:lev=|lev+1..&|
|00000640| 00 21 ff d8 04 04 f0 0f | 20 64 24 3d 22 7d 22 20 |.!......| d$="}" |
|00000650| f6 05 20 6c 28 6c 65 76 | 29 3d 69 3a 6c 65 76 3d |.. l(lev|)=i:lev=|
|00000660| 6c 65 76 2d 31 00 00 46 | 00 22 ff d8 04 06 f0 00 |lev-1..F|."......|
|00000670| 20 f0 0f 20 64 24 3d 61 | 63 74 24 3a 69 3d 69 2b | .. d$=a|ct$:i=i+|
|00000680| 31 3a 76 61 6c 75 65 24 | 3d 62 24 3a 62 24 3d 22 |1:value$|=b$:b$="|
|00000690| 22 f0 5a 20 20 20 20 20 | 20 20 20 20 66 6f 75 6e |".Z | foun|
|000006a0| 64 20 61 6e 20 61 63 74 | 69 6f 6e 20 00 00 00 36 |d an act|ion ...6|
|000006b0| 00 23 ff b8 06 06 f0 0f | 20 61 6c 65 76 3e 3d 6c |.#......| alev>=l|
|000006c0| 65 76 20 f6 05 20 f0 31 | 20 f4 32 28 72 65 67 75 |ev .. .1| .2(regu|
|000006d0| 6c 61 72 24 2c 69 2c 31 | 29 3b 22 3a 22 20 3b 76 |lar$,i,1|);":" ;v|
|000006e0| 61 6c 75 65 24 00 00 0c | 00 24 ff c8 04 04 f0 1f |alue$...|.$......|
|000006f0| 20 f0 0f 00 00 36 00 00 | ff f2 04 04 f0 0f 20 64 | ....6..|...... d|
|00000700| 24 3d 22 2a 22 20 f6 05 | 20 f0 0f 20 61 6c 65 76 |$="*" ..| .. alev|
|00000710| 3e 6c 65 76 20 f6 05 20 | 61 6c 65 76 3d 6c 65 76 |>lev .. |alev=lev|
|00000720| 3a 69 3d 6c 28 6c 65 76 | 29 2d 31 00 00 4e 00 00 |:i=l(lev|)-1..N..|
|00000730| ff c8 04 04 f0 13 20 74 | 68 65 20 73 69 6d 70 6c |...... t|he simpl|
|00000740| 65 20 72 65 63 6f 67 6e | 69 7a 65 72 20 6f 6e 6c |e recogn|izer onl|
|00000750| 79 20 61 63 63 75 6d 75 | 6c 61 74 65 73 20 74 68 |y accumu|lates th|
|00000760| 65 20 63 68 61 72 63 74 | 65 72 73 20 61 6e 64 20 |e charct|ers and |
|00000770| 70 72 69 6e 74 73 20 74 | 68 65 6d 00 00 1a 00 26 |prints t|hem....&|
|00000780| ff b0 04 06 f0 00 20 f0 | 0f 20 6c 61 73 74 64 24 |...... .|. lastd$|
|00000790| 3d 6d 65 74 61 24 00 00 | 00 36 00 00 ff e4 06 06 |=meta$..|.6......|
|000007a0| f0 0f 20 20 f2 02 20 72 | 65 63 6f 67 6e 69 7a 65 |.. .. r|ecognize|
|000007b0| 28 63 24 2c 64 24 29 20 | f6 05 20 62 24 3d 62 24 |(c$,d$) |.. b$=b$|
|000007c0| 2b 63 24 3a f0 0d 20 22 | 66 6f 75 6e 64 22 00 00 |+c$:.. "|found"..|
|000007d0| 00 0c 00 28 ff c8 04 04 | f0 1f 20 f0 0f 00 00 1a |...(....|.. .....|
|000007e0| 00 29 ff f2 04 04 f0 0f | 20 63 24 3c 3e 64 24 20 |.)......| c$<>d$ |
|000007f0| f6 05 20 22 6e 78 74 22 | 00 00 00 40 00 2a ff e4 |.. "nxt"|...@.*..|
|00000800| 04 04 22 66 6f 75 6e 64 | 22 6a 3d 6a 2b 31 3a 63 |.."found|"j=j+1:c|
|00000810| 24 3d f4 32 28 74 65 73 | 74 73 74 72 69 6e 67 24 |$=.2(tes|tstring$|
|00000820| 2c 6a 2c 31 29 3a f0 0f | 20 63 24 3c 3e 22 22 20 |,j,1):..| c$<>"" |
|00000830| f6 05 20 61 6c 65 76 3d | 6c 65 76 00 00 1a 00 2b |.. alev=|lev....+|
|00000840| ff be 02 02 22 6e 78 74 | 22 69 3d 69 2b 31 3a f0 |...."nxt|"i=i+1:.|
|00000850| 34 20 69 3e 6c 61 00 00 | 00 22 00 2c ff e4 00 00 |4 i>la..|.".,....|
|00000860| f0 1f 20 f2 02 20 20 20 | 20 20 20 20 20 20 20 20 |.. .. | |
|00000870| 20 20 20 20 20 20 20 20 | 20 20 00 00 00 58 00 2d | | ...X.-|
|00000880| ff dc 00 00 f0 13 20 20 | 20 20 20 20 20 20 20 6f |...... | o|
|00000890| 75 72 20 74 65 73 74 20 | 69 73 20 74 6f 20 20 70 |ur test |is to p|
|000008a0| 61 72 73 65 20 32 34 78 | 5e 32 2b 32 78 5e 32 79 |arse 24x|^2+2x^2y|
|000008b0| 5e 33 34 2b 7a 3d 20 32 | 33 35 31 36 20 61 6e 64 |^34+z= 2|3516 and|
|000008c0| 20 50 52 49 4e 54 20 6f | 75 74 20 74 68 65 20 76 | PRINT o|ut the v|
|000008d0| 61 6c 75 65 73 00 00 08 | 00 2e ff a6 00 00 00 00 |alues...|........|
|000008e0| 00 2c 00 2f ff f6 00 00 | 74 65 73 74 73 74 72 69 |.,./....|teststri|
|000008f0| 6e 67 24 3d 22 32 34 78 | 21 32 2b 32 78 21 32 79 |ng$="24x|!2+2x!2y|
|00000900| 21 33 34 2b 7a 3d 32 33 | 35 31 36 22 00 00 00 34 |!34+z=23|516"...4|
|00000910| 00 30 ff d2 fe 00 f2 02 | 20 70 61 72 73 65 28 61 |.0......| parse(a|
|00000920| 24 2c 74 65 73 74 73 74 | 72 69 6e 67 24 29 3a f0 |$,testst|ring$):.|
|00000930| 37 20 f2 0b 28 5f 64 6f | 77 6e 29 3d 30 3a f0 38 |7 ..(_do|wn)=0:.8|
|00000940| 3a f0 1f 00 00 1a 00 31 | ff ca 00 00 f0 13 20 61 |:......1|...... a|
|00000950| 6e 6f 74 68 65 72 20 65 | 78 61 6d 70 6c 65 00 00 |nother e|xample..|
|00000960| 00 24 00 32 ff e4 00 00 | f0 5a 61 24 3d 22 7b 26 |.$.2....|.Za$="{&|
|00000970| 53 24 61 7b 26 4f 26 50 | 26 53 26 50 24 65 7d 2a |S$a{&O&P|&S&P$e}*|
|00000980| 24 66 7d 22 00 00 00 2a | 00 33 ff da 00 00 f0 5a |$f}"...*|.3.....Z|
|00000990| 74 65 73 74 73 74 72 69 | 6e 67 24 3d 22 78 2b 28 |teststri|ng$="x+(|
|000009a0| 61 2a 62 2f 28 63 2d 64 | 29 29 2d 6a 2b 6c 2a 79 |a*b/(c-d|))-j+l*y|
|000009b0| 22 00 00 38 00 34 ff d4 | 00 00 f0 5a 70 24 28 31 |"..8.4..|...Zp$(1|
|000009c0| 29 3d 22 53 3e 41 7a 22 | 3a 50 24 28 32 29 3d 22 |)="S>Az"|:P$(2)="|
|000009d0| 4f 3d 2b 3d 2d 3d 3d 3d | 2f 3d 2a 22 3a 50 24 28 |O=+=-===|/=*":P$(|
|000009e0| 33 29 3d 22 50 3d 28 3d | 29 22 00 00 00 0a ff ff |3)="P=(=|)"......|
|000009f0| ff c6 ff 36 f0 12 00 00 | |...6....| |
+--------+-------------------------+-------------------------+--------+--------+